.class public final Llt/noframe/ratemeplease/api/ApiClient;
.super Ljava/lang/Object;
.source "ApiClient.kt"


# instance fields
.field private final TAG:Ljava/lang/String;

.field private final retrofit:Lretrofit2/Retrofit;

.field private final reviewApi:Llt/noframe/ratemeplease/api/services/RatingApi;


# direct methods
.method public constructor <init>()V
    .locals 2

    .line 25
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const-string v0, "ApiClient"

    .line 26
    iput-object v0, p0, Llt/noframe/ratemeplease/api/ApiClient;->TAG:Ljava/lang/String;

    .line 28
    new-instance v0, Lretrofit2/Retrofit$Builder;

    invoke-direct {v0}, Lretrofit2/Retrofit$Builder;-><init>()V

    .line 29
    sget-object v1, Llt/noframe/ratemeplease/Conf;->Companion:Llt/noframe/ratemeplease/Conf$Companion;

    invoke-virtual {v1}, Llt/noframe/ratemeplease/Conf$Companion;->getIns()Llt/noframe/ratemeplease/Conf;

    move-result-object v1

    invoke-virtual {v1}, Llt/noframe/ratemeplease/Conf;->getApiUrl()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lretrofit2/Retrofit$Builder;->baseUrl(Ljava/lang/String;)Lretrofit2/Retrofit$Builder;

    .line 30
    invoke-static {}, Lretrofit2/converter/gson/GsonConverterFactory;->create()Lretrofit2/converter/gson/GsonConverterFactory;

    move-result-object v1

    invoke-virtual {v0, v1}, Lretrofit2/Retrofit$Builder;->addConverterFactory(Lretrofit2/Converter$Factory;)Lretrofit2/Retrofit$Builder;

    .line 31
    invoke-virtual {v0}, Lretrofit2/Retrofit$Builder;->build()Lretrofit2/Retrofit;

    move-result-object v0

    const-string v1, "Retrofit.Builder()\n     \u2026e())\n            .build()"

    invoke-static {v0, v1}, Lkotlin/jvm/internal/Intrinsics;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    iput-object v0, p0, Llt/noframe/ratemeplease/api/ApiClient;->retrofit:Lretrofit2/Retrofit;

    .line 36
    iget-object v0, p0, Llt/noframe/ratemeplease/api/ApiClient;->retrofit:Lretrofit2/Retrofit;

    const-class v1, Llt/noframe/ratemeplease/api/services/RatingApi;

    invoke-virtual {v0, v1}, Lretrofit2/Retrofit;->create(Ljava/lang/Class;)Ljava/lang/Object;

    move-result-object v0

    const-string v1, "retrofit.create(RatingApi::class.java)"

    invoke-static {v0, v1}, Lkotlin/jvm/internal/Intrinsics;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    check-cast v0, Llt/noframe/ratemeplease/api/services/RatingApi;

    iput-object v0, p0, Llt/noframe/ratemeplease/api/ApiClient;->reviewApi:Llt/noframe/ratemeplease/api/services/RatingApi;

    return-void
.end method


# virtual methods
.method public final getTAG()Ljava/lang/String;
    .locals 1

    .line 26
    iget-object v0, p0, Llt/noframe/ratemeplease/api/ApiClient;->TAG:Ljava/lang/String;

    return-object v0
.end method

.method public final postReview(Landroid/app/Activity;Landroid/os/Bundle;Ljava/lang/String;)V
    .locals 7

    const-string v0, "activity"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    const-string v0, "bundle"

    invoke-static {p2, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    const-string v0, "appVersion"

    invoke-static {p3, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    const/4 v5, 0x0

    const/4 v6, 0x0

    move-object v1, p0

    move-object v2, p1

    move-object v3, p2

    move-object v4, p3

    .line 40
    invoke-virtual/range {v1 .. v6}, Llt/noframe/ratemeplease/api/ApiClient;->postReview(Landroid/app/Activity;Landroid/os/Bundle;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V

    return-void
.end method

.method public final postReview(Landroid/app/Activity;Landroid/os/Bundle;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V
    .locals 12
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/app/Activity;",
            "Landroid/os/Bundle;",
            "Ljava/lang/String;",
            "Lkotlin/jvm/functions/Function1<",
            "-",
            "Lokhttp3/ResponseBody;",
            "Lkotlin/Unit;",
            ">;",
            "Lkotlin/jvm/functions/Function1<",
            "-",
            "Ljava/lang/String;",
            "Lkotlin/Unit;",
            ">;)V"
        }
    .end annotation

    move-object v0, p1

    move-object v1, p2

    const-string v2, "activity"

    invoke-static {p1, v2}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    const-string v2, "bundle"

    invoke-static {p2, v2}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    const-string v2, "appVersion"

    move-object v11, p3

    invoke-static {p3, v2}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 46
    sget v2, Landroid/os/Build$VERSION;->SDK_INT:I

    const-string v3, "activity.resources"

    const/16 v4, 0x18

    if-lt v2, v4, :cond_0

    .line 47
    invoke-virtual {p1}, Landroid/app/Activity;->getResources()Landroid/content/res/Resources;

    move-result-object v2

    invoke-static {v2, v3}, Lkotlin/jvm/internal/Intrinsics;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    invoke-virtual {v2}, Landroid/content/res/Resources;->getConfiguration()Landroid/content/res/Configuration;

    move-result-object v2

    const-string v3, "activity.resources.configuration"

    invoke-static {v2, v3}, Lkotlin/jvm/internal/Intrinsics;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    invoke-virtual {v2}, Landroid/content/res/Configuration;->getLocales()Landroid/os/LocaleList;

    move-result-object v2

    const/4 v3, 0x0

    invoke-virtual {v2, v3}, Landroid/os/LocaleList;->get(I)Ljava/util/Locale;

    move-result-object v2

    const-string v3, "activity.resources.configuration.locales.get(0)"

    invoke-static {v2, v3}, Lkotlin/jvm/internal/Intrinsics;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    invoke-virtual {v2}, Ljava/util/Locale;->getCountry()Ljava/lang/String;

    move-result-object v2

    const-string v3, "activity.resources.confi\u2026on.locales.get(0).country"

    invoke-static {v2, v3}, Lkotlin/jvm/internal/Intrinsics;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    goto :goto_0

    .line 49
    :cond_0
    invoke-virtual {p1}, Landroid/app/Activity;->getResources()Landroid/content/res/Resources;

    move-result-object v2

    invoke-static {v2, v3}, Lkotlin/jvm/internal/Intrinsics;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    invoke-virtual {v2}, Landroid/content/res/Resources;->getConfiguration()Landroid/content/res/Configuration;

    move-result-object v2

    iget-object v2, v2, Landroid/content/res/Configuration;->locale:Ljava/util/Locale;

    const-string v3, "activity.resources.configuration.locale"

    invoke-static {v2, v3}, Lkotlin/jvm/internal/Intrinsics;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    invoke-virtual {v2}, Ljava/util/Locale;->getCountry()Ljava/lang/String;

    move-result-object v2

    const-string v3, "activity.resources.configuration.locale.country"

    invoke-static {v2, v3}, Lkotlin/jvm/internal/Intrinsics;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    :goto_0
    move-object v7, v2

    .line 53
    new-instance v2, Llt/noframe/ratemeplease/api/models/UserModel;

    .line 54
    sget-object v3, Llt/noframe/ratemeplease/utils/DeviceInfoUtils;->INSTANCE:Llt/noframe/ratemeplease/utils/DeviceInfoUtils;

    invoke-virtual {v3, p1}, Llt/noframe/ratemeplease/utils/DeviceInfoUtils;->getGoogleEmail(Landroid/app/Activity;)Ljava/lang/String;

    move-result-object v4

    .line 55
    sget-object v3, Llt/noframe/ratemeplease/utils/DeviceInfoUtils;->INSTANCE:Llt/noframe/ratemeplease/utils/DeviceInfoUtils;

    invoke-virtual {v3, p1}, Llt/noframe/ratemeplease/utils/DeviceInfoUtils;->getDeviceID(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v5

    .line 56
    invoke-static {}, Ljava/util/Locale;->getDefault()Ljava/util/Locale;

    move-result-object v3

    const-string v6, "Locale.getDefault()"

    invoke-static {v3, v6}, Lkotlin/jvm/internal/Intrinsics;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    invoke-virtual {v3}, Ljava/util/Locale;->getLanguage()Ljava/lang/String;

    move-result-object v6

    const-string v3, "Locale.getDefault().language"

    invoke-static {v6, v3}, Lkotlin/jvm/internal/Intrinsics;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 58
    sget-object v8, Landroid/os/Build;->MANUFACTURER:Ljava/lang/String;

    const-string v3, "android.os.Build.MANUFACTURER"

    invoke-static {v8, v3}, Lkotlin/jvm/internal/Intrinsics;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 59
    sget-object v9, Landroid/os/Build;->MODEL:Ljava/lang/String;

    const-string v3, "android.os.Build.MODEL"

    invoke-static {v9, v3}, Lkotlin/jvm/internal/Intrinsics;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 60
    sget-object v10, Landroid/os/Build$VERSION;->CODENAME:Ljava/lang/String;

    const-string v3, "android.os.Build.VERSION.CODENAME"

    invoke-static {v10, v3}, Lkotlin/jvm/internal/Intrinsics;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    move-object v3, v2

    move-object v11, p3

    .line 53
    invoke-direct/range {v3 .. v11}, Llt/noframe/ratemeplease/api/models/UserModel;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    .line 65
    new-instance v3, Llt/noframe/ratemeplease/api/models/ReviewModel;

    .line 66
    invoke-virtual {p1}, Landroid/app/Activity;->getApplicationInfo()Landroid/content/pm/ApplicationInfo;

    move-result-object v0

    iget-object v0, v0, Landroid/content/pm/ApplicationInfo;->packageName:Ljava/lang/String;

    const-string v4, "activity.applicationInfo.packageName"

    invoke-static {v0, v4}, Lkotlin/jvm/internal/Intrinsics;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 67
    sget-object v4, Llt/noframe/ratemeplease/RateMePls;->BUNDLE_RATING_STARS:Ljava/lang/String;

    invoke-virtual {p2, v4}, Landroid/os/Bundle;->getFloat(Ljava/lang/String;)F

    move-result v4

    .line 68
    sget-object v5, Llt/noframe/ratemeplease/RateMePls;->BUNDLE_RATING_FEEDBACK:Ljava/lang/String;

    invoke-virtual {p2, v5}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    const-string v5, "bundle.getString(RateMePls.BUNDLE_RATING_FEEDBACK)"

    invoke-static {v1, v5}, Lkotlin/jvm/internal/Intrinsics;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 65
    invoke-direct {v3, v0, v1, v4, v2}, Llt/noframe/ratemeplease/api/models/ReviewModel;-><init>(Ljava/lang/String;Ljava/lang/String;FLlt/noframe/ratemeplease/api/models/UserModel;)V

    move-object v0, p0

    move-object/from16 v1, p4

    move-object/from16 v2, p5

    .line 72
    invoke-virtual {p0, v3, v1, v2}, Llt/noframe/ratemeplease/api/ApiClient;->postReview(Llt/noframe/ratemeplease/api/models/ReviewModel;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V

    return-void
.end method

.method public final postReview(Llt/noframe/ratemeplease/api/models/ReviewModel;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Llt/noframe/ratemeplease/api/models/ReviewModel;",
            "Lkotlin/jvm/functions/Function1<",
            "-",
            "Lokhttp3/ResponseBody;",
            "Lkotlin/Unit;",
            ">;",
            "Lkotlin/jvm/functions/Function1<",
            "-",
            "Ljava/lang/String;",
            "Lkotlin/Unit;",
            ">;)V"
        }
    .end annotation

    const-string v0, "model"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 80
    iget-object v0, p0, Llt/noframe/ratemeplease/api/ApiClient;->reviewApi:Llt/noframe/ratemeplease/api/services/RatingApi;

    invoke-interface {v0, p1}, Llt/noframe/ratemeplease/api/services/RatingApi;->postReview(Llt/noframe/ratemeplease/api/models/ReviewModel;)Lretrofit2/Call;

    move-result-object p1

    new-instance v0, Llt/noframe/ratemeplease/api/ApiClient$postReview$1;

    invoke-direct {v0, p0, p3, p2}, Llt/noframe/ratemeplease/api/ApiClient$postReview$1;-><init>(Llt/noframe/ratemeplease/api/ApiClient;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V

    invoke-interface {p1, v0}, Lretrofit2/Call;->enqueue(Lretrofit2/Callback;)V

    return-void
.end method
